<?php
use_helper("Date");
slot("shop_slot");
$Prices=$Publication->getSortedAvaliablesPrices();
$qtyPrices=count($Prices);
$minWidth=200;
$maxWidth=250;
$width=0;
$totalWidth;
if($qtyPrices<=2){
	$width=$maxWidth;
}else{
	$width=$minWidth;
}
$totalWidth=($width*$qtyPrices)+(10*$qtyPrices);
?>
<div>
    <table class="select-price" style="width:<?php echo $totalWidth."px"; ?> height: 100%" align="center">
    	<tr>
        <?php 
        $Course=$Publication->getCourse();
        foreach($Prices as $Price){ ?> 
        <td class="price-item" style="width:<?php echo $width."px"?>; height: 200px">
            <div class="price-window shadown">
            	<div class="top">
                	<span class="bold f13em"><?php echo  $Price->getDescription() ?></span><div><span class="price-amount"><?php echo  $Price->getTotalPrice() ?></span><span class="price-currency">BsF.</span></div>
                </div>
                <div class="midle">
                	<table class="tbl-short" >
                		<tbody>
	                		<?php
	                		foreach($Price->getCustomizations() as $key=>$custom){
	                			?>
	                			<tr>
	                				<td title="<?php echo __("Fecha límite para realizar el Pago")?>"><?php echo format_date($custom->getExpiresAt(),"D")  ?></td>
	                				<td><span class="bold f13em"><?php echo $custom->getAmount()?></span></td> 
	                			</tr>
	                			<?php 
	                		}?>
                		</tbody>
                	</table>
                </div>
                <div>
                	<a href="<?php echo url_for("@confirm_shop_course?token={$token}&pprice_id={$Price->getId()}&course_slug={$Course->getSlug()}") ?>" class="btn-select-payment"><?php echo __("Seleccionar Esta Forma de Pago") ?></a>
                </div>
            </div>
        </td>
       <?php } ?>
       </tr>
    </table>
</div>
<?php end_slot(); ?>
<?php include_partial("shopLayout", array("selected"=>1))?>